package com.rom.ratethehell.entities;

import java.util.ArrayList;

import android.graphics.Bitmap;

public class RatePicture extends Picture {
	private Double rating;
	private ArrayList<Comment> comments = new ArrayList<Comment>(0);
	private Long numOfRaters;
	public RatePicture(long id,Bitmap decodeByteArray,Double rating,Long numOfRaters) {
		super(id,decodeByteArray);
		this.rating=rating;
		this.numOfRaters = numOfRaters;
	}

	public Double getRating() {
		return rating;
	}

	public ArrayList<Comment> getComments() {
		return comments;
	}

	public void addComment(Comment comment) {
		comments.add(comment);
	}

	public double getNewRating(double myRating) {
		return (numOfRaters*rating + myRating)/(numOfRaters+1);
	}
}
